From c9501438bb98d1812721ede44b76100a20c90c68 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 4 Aug 2005 16:53:11 +0000 Subject: [PATCH] Fix event-upcall masking when creating a trap frame on guest kernel stack. Previously an exception would clear an already-set mask. Signed-off-by: Keir Fraser --- xen/arch/x86/x86_32/entry.S | 3 ++- xen/arch/x86/x86_64/entry.S | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S index d33665d0a2..52a5449f74 100644 --- a/xen/arch/x86/x86_32/entry.S +++ b/xen/arch/x86/x86_32/entry.S @@ -335,7 +335,8 @@ FLT14: movl %eax,%gs:(%esi) movl VCPU_vcpu_info(%ebx),%eax pushl VCPUINFO_upcall_mask(%eax) testb $TBF_INTERRUPT,%cl - setnz VCPUINFO_upcall_mask(%eax) # TBF_INTERRUPT -> clear upcall mask + setnz %al # TBF_INTERRUPT -> set upcall mask + orb %al,VCPUINFO_upcall_mask(%eax) popl %eax shll $16,%eax # Bits 16-23: saved_upcall_mask movw UREGS_cs+4(%esp),%ax # Bits 0-15: CS diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index 3ba426ad2a..d71e38ace4 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -314,7 +314,8 @@ FLT4: movq %rax,16(%rsi) # RFLAGS movq VCPU_vcpu_info(%rbx),%rax pushq VCPUINFO_upcall_mask(%rax) testb $TBF_INTERRUPT,%cl - setnz VCPUINFO_upcall_mask(%rax)# TBF_INTERRUPT -> clear upcall mask + setnz %al # TBF_INTERRUPT -> set upcall mask + orb %al,VCPUINFO_upcall_mask(%rax) popq %rax shlq $32,%rax # Bits 32-39: saved_upcall_mask movw UREGS_cs+8(%rsp),%ax # Bits 0-15: CS -- 2.30.2